let seq = require("../db/seq");

const { DataTypes } = require("sequelize");

const User = seq.define(
  "sbdz_User",
  {
    username: {
      type: DataTypes.STRING,
      allowNull: false,
      unique: true,
      comment: "用户名，唯一",
    },
    password: {
      type: DataTypes.CHAR(64),
      allowNull: false,
      comment: "密码",
    },
    is_admin: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: 0,
      comment: "是否为管理员,0不会管理员(默认),1:是管理员",
    },
  },
  {
    timestamps: false,
  }
);

User.sync();
module.exports = User;
